package pattern;

import java.util.Timer;
import java.util.TimerTask;

/**
 * Created with IntelliJ IDEA.
 * Description:标准库定时器
 * User: 东莞呵呵
 * Date:2022-09-20
 * Time:15:42
 */
public class Demo4 {
    public static void main(String[] args) {
        Timer timer=new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("时间到");
            }
        },3000);
        System.out.println("开始计时");
    }
}
